package com.gupaoedu.vip.pattern.factory.simple;

import com.gupaoedu.vip.pattern.factory.Audi;
import com.gupaoedu.vip.pattern.factory.BenZ;
import com.gupaoedu.vip.pattern.factory.Bmw;
import com.gupaoedu.vip.pattern.factory.Car;

/**tring
 * Created by Administrator on 2018/3/18.
 */
public class SimpleFactory {

    public static Car getCar(String carType){
        if("audi".equals(carType)){
            return new Audi();
        }else if("bmw".equals(carType)){
            return new Bmw();
        }else if("benz".equals(carType)){
            return new BenZ();
        }
        return null;
    }
}
